package org.campuscontent.ui;

import javax.swing.JScrollPane;

import org.campuscontent.config.Config;
import org.campuscontent.main.MainFrame;
import org.campuscontent.model.AllocTable;

public class Template14 extends TemplateBase
{
	public static int paraID = 14;
	
	public Template14(MainFrame mf)
	{
		super(mf);
		alloc = new AllocTable(mf);
		allocScrollPane = new JScrollPane(alloc); 
		allocScrollPane.setBounds(5, 5, 600, 160);

		left.add(allocScrollPane);
		initView();
	}


	public void initView()
	{
		mf.rootPanel.setDividerLocation(Config.POSITION_TO_SHOW_ALLOC);
		this.setDividerLocation(Config.POSITION_TO_HIDE_PROBLEM_CONTROLS);
	}

	public String getAnswer()
	{
		return "";
	}
	
	public boolean setPreview()
	{
		if (!super.setPreview()) return false;
		this.setDividerLocation(Config.POSITION_TO_SHOW_PROBLEM_CONTROLS);
		return true;
	}

	public boolean exitPreview()
	{
		super.exitPreview();
		return true;
	}

	public String checkAns()
	{
		return "";
	}

	public void showSolution()
	{
		super.showSolution();
	}
	
	public boolean updateToLObjectNew()
	{
//		//first check if the user have set the 
//		sAnswer = getAnswer();
//		if (sAnswer.equals("none#none#none#none#"))
//		{
//			JOptionPane.showMessageDialog(getWindowForComponent(mf.applet), "You should set the answer!");
//			return false;
//		} else
		{
			super.updateToLObjectNew();
			return true;
		}
	}
	public int getId()
	{
		return paraID;
	}
	
}
